<? 
include("views/cabecera_listado.php"); 
?>

<table width="100%" cellpadding="0" cellspacing="0" align="center" border="0" bgcolor="#FFFFFF" id="listado">
	<?
    	$coleccion = $result[0];
		$cant = $result[1];
		if($cant > 40)
		{
			include ('views/paginador.php');
		}
	?>
	
	<tr>
    	<th width="" align="center" height="25"></th>
		<th align="left" width="">NRO. </th>
        <th align="left" width="">NOMBRE</th>
        <th align="left" width="">APELLIDO</th>
        <th align="left" width="">DNI</th>
        <th align="left" width="">EMPRESA</th>
        <th align="left" width="">FECHA ALTA</th>
        <th align="left" width="">HABILITADO</th>
        <th align="left" width=""><input type="checkbox" name="todos" value="" <? if($_SESSION["todos_imp"] == "S") { echo("checked"); } ?> id="todos" onclick="selectTodos()" /></th>
    </tr>
	<?php
	
	for($j=0; $j<$coleccion->get_count(); $j++) 
	{
		$datoTmp = &$coleccion->items[$j];
			
	?>
	<tr bgcolor="#FFFFFF" id="fila_<?php echo ($datoTmp->get_data("id")) ?>">
    	<td height=""></td>
        <td align="left" width="10%"><?php echo ($datoTmp->get_data("id")) ?></td>
		<td align="left" width="15%"><?php echo ($datoTmp->get_data("nombre")) ?></td>
        <td align="left" width="15%"><?php echo ($datoTmp->get_data("apellido")) ?></td>
        <td align="left" width="10%"><?php echo ($datoTmp->get_data("dni")) ?></td>
        <td align="left" width="15%"><?php echo ($datoTmp->get_data("razon_social")) ?></td>
        <td align="left" width="10%"><?=($datoTmp->get_data("fecha_alta")=="0000-00-00") ? "" : formatoFecha($datoTmp->get_data("fecha_alta"),"yyyy-mm-dd","dd/mm/yyyy"); ?></td>
        <td align="left" width="10%"><?php echo ($datoTmp->get_data("habilitado")) ?></td>
        <td align="left" width="10%">
        <input type="checkbox" name="chck_<? echo($datoTmp->get_data("id")) ?>" <? if(in_array($datoTmp->get_data("id"),$_SESSION["array_cont"])){ echo("checked"); } ?> id="<? echo($datoTmp->get_data("id")) ?>" onclick="selectIndividual(<?php echo ($datoTmp->get_data("id")) ?>)" />
        </td>
	</tr>
    <tr bgcolor="#FFFFFF" id="fila_sep_<?php echo ($datoTmp->get_data("id")) ?>">
    	<td colspan="9" style="border-bottom:solid; border-bottom-width:2px; border-bottom-color:#CCCCCC; "></td>
	</tr>
	<?php
	}
	?>
	
    </table>
    
<? include("views/pie_listado.php"); ?>